package cn.jd.payserver;

import cn.jd.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class HystrixClientFallbackFactory implements FallbackFactory<UserServer> {

    @Override
    public UserServer create(Throwable throwable) {
        return new UserServer() {
            @Override
            public User userById(Integer id) {
                return new User(id,"网络繁忙","稍后再试",".....");
            }
        };
    }
}
